-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove renderEra. Rename prettyTo* to docTo* functions #387
Conversation
4a2e6de
to
da98674
Compare
@@ -30,14 +30,14 @@ import Prettyprinter.Render.Terminal | |||
-- of colored output. This is a type alias for AnsiStyle. | |||
type Ann = AnsiStyle | |||
|
|||
prettyToString :: Doc AnsiStyle -> String | |||
prettyToString = show | |||
docToString :: Doc AnsiStyle -> String |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those functions weren't accepting Pretty a => a
but Doc
so their names were misleading and it was resulting in oddities like: prettyToString . pretty
@@ -242,16 +244,11 @@ deriving instance Eq (CardanoEra era) | |||
deriving instance Ord (CardanoEra era) | |||
deriving instance Show (CardanoEra era) | |||
|
|||
deriving via (ShowOf (CardanoEra era)) instance Pretty (CardanoEra era) | |||
instance Pretty (CardanoEra era) where |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now Pretty
instance does not print Era
suffix which makes it suitable to use in console logging and error messages building.
791ed7a
to
e101f0c
Compare
e101f0c
to
b8593f0
Compare
b8593f0
to
f279a06
Compare
Changelog
Context
This PR introduces consistency in prettyprinting functions naming and simplifies rendering of names of eras.
How to trust this PR
Highlight important bits of the PR that will make the review faster. If there are commands the reviewer can run to observe the new behavior, describe them.
Checklist